/**
 * 
 */
package cn.com.klun.netty.client;

import cn.com.klun.factory.TaskListenerClientFactory;
import cn.com.klun.netty.NettyMessage;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author chenmin-ds
 *
 */
public class NettyClientTaskInfoHandler extends SimpleChannelInboundHandler<NettyMessage> {

	private TaskListenerClientFactory taskListenerClientFactory;
	
	public NettyClientTaskInfoHandler(TaskListenerClientFactory taskListenerClientFactory){
		this.taskListenerClientFactory = taskListenerClientFactory;
	}
	
	@Override
	protected void channelRead0(ChannelHandlerContext ctx, NettyMessage msg)
			throws Exception {
		//接收服务传回来的信息
		taskListenerClientFactory.businessAdapter(msg);
	}

}
